﻿<%@ Page Language="C#" MasterPageFile="~/Master/EditMasterPage.master" AutoEventWireup="True" Inherits="Web.Article_Edit" Title="" Codebehind="Edit.aspx.cs" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
     <script type="text/javascript">
         //选择名称
         function OpenTreeColumn() {
             openDlgWindow(window, "选择计划", "/_Common/SelectColumn.aspx", SetItemValueColumn, true, 520, 300);
         }
         //获得选择
         function SetItemValueColumn(returnVal) {
             if (returnVal != "") {
                 document.getElementById("<%=txt_ColumnId.ClientID %>").value = returnVal.pkid;
                 document.getElementById("<%=txt_ColumnName.ClientID %>").value = returnVal.Title;
             }
         }
        //选择名称
        function OpenTreePlantable() {
            openDlgWindow(window, "选择计划", "/_Common/SelectPlantable.aspx", SetItemValuePlantable, true, 600, 300);
        }
        //获得选择
        function SetItemValuePlantable(returnVal) {
            if (returnVal != "") {
                document.getElementById("<%=txt_PlanId.ClientID %>").value = returnVal.pkid;
                document.getElementById("<%=txt_PlanName.ClientID %>").value = returnVal.Jhname;
            }
        }
    </script>
   <table class="edit_table" border="1" cellpadding="0" cellspacing="0">
        <tr runat="server" visible="false">
            <td class="edit_alt_item td1">
                ：</td>
            <td class="td2">
                <asp:TextBox ID="txt_ChannelId" runat="server" ValidationGroup="Save"
                    newfield="ChannelId" newtype="int" notice="" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                栏目：</td>
            <td class="td2">
                <asp:TextBox ID="txt_ColumnId" runat="server" ValidationGroup="Save"
                    newfield="ColumnId" newtype="int" notice="栏目名称" null="False"
                    CssClass="t_longnum" MaxLength="4" size="4" style="display:none" />
                <asp:TextBox ID="txt_ColumnName" runat="server" ValidationGroup="Save"
                    newfield="ColumnName" newtype="string" notice="栏目名称" null="False"
                    CssClass="t_common" MaxLength="50" size="50" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorColumnName" runat="server" 
                    ControlToValidate="txt_ColumnName" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于50" ValidationExpression="^.{0,49}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
                <asp:Button ID="ColumnButton" CssClass="btn_Button" ToolTip="选择" CommandName="btnSelect"
                    runat="server" OnClientClick="OpenTreeColumn(); return false;" Text="选择" />
                <span ishow="false" style="color: Red;">*</span>
           </td>
            <td class="edit_alt_item td3">
                所属计划：</td>
            <td class="td4">
                <asp:TextBox ID="txt_PlanId" runat="server" ValidationGroup="Save"
                    newfield="PlanId" newtype="int" notice="所属计划" null="True"
                    CssClass="t_num" MaxLength="3" size="3" style="display:none"/>
                <asp:TextBox ID="txt_PlanName" runat="server" ValidationGroup="Save"
                    newfield="PlanName" newtype="string" notice="所属计划" null="true"
                    CssClass="t_common" />
                <asp:Button ID="Button1" CssClass="btn_Button" ToolTip="选择" CommandName="btnSelect"
                    runat="server" OnClientClick="OpenTreePlantable(); return false;" Text="选择" />
                <%--<span ishow="false" style="color: Red;">*</span>--%>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                标题：</td>
            <td class="td2">
                <asp:TextBox ID="txt_Title" runat="server" ValidationGroup="Save"
                    newfield="Title" newtype="string" notice="标题" null="False"
                    CssClass="t_longer" MaxLength="255" size="255" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorTitle" runat="server" 
                    ControlToValidate="txt_Title" CssClass="warning" Display="Dynamic"
                    ErrorMessage="必须填写" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorTitle" runat="server" 
                    ControlToValidate="txt_Title" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于255" ValidationExpression="^.{0,254}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
                <span ishow="false" style="color: Red;">*</span>
            </td>
            <td class="edit_alt_item td3">
                副标题：</td>
            <td class="td4">
                <asp:TextBox ID="txt_SubTitle" runat="server" ValidationGroup="Save"
                    newfield="SubTitle" newtype="string" notice="副标题" null="True"
                    CssClass="t_longer" MaxLength="50" size="50" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorSubTitle" runat="server" 
                    ControlToValidate="txt_SubTitle" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于50" ValidationExpression="^.{0,49}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                作者：</td>
            <td class="td2">
                <asp:TextBox ID="txt_Author" runat="server" ValidationGroup="Save"
                    newfield="Author" newtype="string" notice="作者" null="True"
                    CssClass="t_common" MaxLength="16" size="16" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorAuthor" runat="server" 
                    ControlToValidate="txt_Author" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于16" ValidationExpression="^.{0,15}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
            <td class="edit_alt_item td3">
                颜色标题：</td>
            <td class="td4">
                <asp:TextBox ID="txt_TitleColor" runat="server" ValidationGroup="Save"
                    newfield="TitleColor" newtype="string" notice="颜色标题" null="True"
                    CssClass="t_common" MaxLength="50" size="50" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorTitleColor" runat="server" 
                    ControlToValidate="txt_TitleColor" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于50" ValidationExpression="^.{0,49}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                内容：</td>
            <td class="td2" colspan="3">
                <asp:TextBox ID="txt_Content" runat="server" ValidationGroup="Save"
                    newfield="Content" newtype="string" notice="内容" null="True"
                    CssClass="t_common" MaxLength="16" size="16" style="display:none" />
		        <iframe ID="eWebEditor1" src="../@ewebeditor/ewebeditor.htm?id=<%=txt_Content.ClientID %>&style=light" frameborder="0" scrolling="no" width="550" height="350"></iframe>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                摘要：</td>
            <td class="td2" colspan="3">
                <asp:TextBox ID="txt_Summary" runat="server" ValidationGroup="Save" TextMode="MultiLine"
                    newfield="Summary" newtype="string" notice="摘要,同时用于seo" null="True"
                    CssClass="t_area"  />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorSummary" runat="server" 
                    ControlToValidate="txt_Summary" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于500" ValidationExpression="^.{0,499}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                关键字：</td>
            <td class="td2">
                <asp:TextBox ID="txt_KeyWords" runat="server" ValidationGroup="Save"
                    newfield="KeyWords" newtype="string" notice="关键字,用于seo" null="True"
                    CssClass="t_longer" MaxLength="200" size="200" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorKeyWords" runat="server" 
                    ControlToValidate="txt_KeyWords" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于200" ValidationExpression="^.{0,199}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
            <td class="edit_alt_item td3">
                浏览次数：</td>
            <td class="td4">
                <asp:Label ID="txt_ViewNum" runat="server" newfield="ViewNum" newtype="int" notice="浏览次数" null="True"
                    CssClass="t_longnum" />
            </td>
        </tr>
        <tr runat="server" visible="false">
            <td class="edit_alt_item td1">
                回复次数：</td>
            <td class="td2">
                <asp:TextBox ID="txt_ReviewNum" runat="server" ValidationGroup="Save"
                    newfield="ReviewNum" newtype="int" notice="回复次数" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
            </td>
            <td class="edit_alt_item td3">
                用户id：</td>
            <td class="td4">
                <asp:TextBox ID="txt_UserId" runat="server" ValidationGroup="Save"
                    newfield="UserId" newtype="int" notice="用户id" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                是否审核：</td>
            <td class="td2">
                <asp:CheckBox ID="txt_IsPass" runat="server" ValidationGroup="Save"
                    newfield="IsPass" newtype="int" notice="是否审核" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
            </td>
            <td class="edit_alt_item td3">
                是否置顶：</td>
            <td class="td4">
                <asp:CheckBox ID="txt_IsTop" runat="server" ValidationGroup="Save"
                    newfield="IsTop" newtype="int" notice="是否置顶" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                是否是图片文章：
                </td>
            <td class="td2">
                <asp:CheckBox ID="txt_IsImg" runat="server" ValidationGroup="Save"
                    newfield="IsImg" newtype="int" notice="是否是图片文章" null="True"
                    CssClass="t_longnum" MaxLength="4" size="4" />
                图片地址：
                <asp:TextBox ID="txt_Img" runat="server" ValidationGroup="Save"
                    newfield="Img" newtype="string" notice="图片地址" null="True"
                    CssClass="t_long" MaxLength="150" size="150" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorImg" runat="server" 
                    ControlToValidate="txt_Img" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于150" ValidationExpression="^.{0,149}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
            <td class="edit_alt_item td3">
                是否是外部链接：
               </td>
            <td class="td4">
                外部链接：
                <asp:CheckBox ID="txt_IsOut" runat="server" ValidationGroup="Save"
                    newfield="IsOut" newtype="int" notice="是否是外部链接" null="True"
                    CssClass="t_longnum" />
                <asp:TextBox ID="txt_OutUrl" runat="server" ValidationGroup="Save"
                    newfield="OutUrl" newtype="string" notice="外部链接" null="True"
                    CssClass="t_long" MaxLength="150" size="150" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidatorOutUrl" runat="server" 
                    ControlToValidate="txt_OutUrl" CssClass="warning" Display="Dynamic" 
                    ErrorMessage="字符数要小于150" ValidationExpression="^.{0,149}" SetFocusOnError="True" 
                    ValidationGroup="Save"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="edit_alt_item td1">
                创建时间：</td>
            <td class="td2">
                <asp:TextBox ID="txt_CreatDate" runat="server" ValidationGroup="Save"
                    newfield="CreatDate" newtype="DateTime" notice="创建时间" null="False" DateFormat="yyyy-MM-dd"
                    CssClass="t_date" MaxLength="10" size="10" onclick="WdatePicker({el:this.id,dateFmt:'yyyy-MM-dd', skin:'whyGreen'})"/>
                <span ishow="false" style="color: Red;">*</span>
            </td>
            <td class="edit_alt_item td3">
                更新时间：</td>
            <td class="td4">
                <asp:TextBox ID="txt_UpdateDate" runat="server" ValidationGroup="Save"
                    newfield="UpdateDate" newtype="DateTime" notice="更新时间" null="False" DateFormat="yyyy-MM-dd"
                    CssClass="t_date" MaxLength="10" size="10" onclick="WdatePicker({el:this.id,dateFmt:'yyyy-MM-dd', skin:'whyGreen'})"/>
                <span ishow="false" style="color: Red;">*</span>
            </td>
        </tr>
    </table>

    <div class="edit_btn_group">
        <asp:Button ID="saveButton" CssClass="btn_Button" runat="server" OnClick="saveButton_Click" OnClientClick="return Checked();" Text="保存" ValidationGroup="Save"></asp:Button>
        &nbsp;&nbsp;
        <input type="button" ishow="true" class="btn_Button" id="returnInput" runat="server" onclick="window.close();" value="关闭" />
    </div>
</asp:Content>

